package com.StarStudio.DAO;

import com.ruoyi.common.core.Entity.BeansAction;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
@SuppressWarnings("all")
public interface BeansActionDAO {

    List<BeansAction> findBeansActionList(BeansAction beansAction);

    @Select("select * from beans_action where beans_action_id = #{id}")
    BeansAction findByBeansAction_id(long id);

    @Select("select * from beans_action where beans_action_user_id = #{id}")
    List<BeansAction> findByBeansAction_user_id(long id);

    @Delete("delete from beans_action where beans_action_id = #{id}")
    void deleteBeansActionById(long id);

    @Insert("insert into beans_action values (#{beans_action_id},#{beans_action_user_id},#{beans_action_type},#{beans_action_number},#{beans_action_describe},#{beans_action_time})")
    void addBeansAction(BeansAction beansAction);

    @Update("update beans_action set beans_action_user_id = #{beans_action_user_id},beans_action_type = #{beans_action_type},beans_action_number = #{beans_action_number},beans_action_describe = #{beans_action_describe}," +
            "beans_action_time = #{beans_action_time} where beans_action_id = #{beans_action_id}")
    void updateBeansAction(BeansAction beansAction);

    @Select("select count(*) from beans_action")
    long findAllRecordNumber();
}
